<?php

require_once('StringLoadingStrategyInterface.php');

class RandomStringLoadingStrategy implements StringLoadingStrategyInterface {

    /**
     *
     * @param int $loadParam
     * @return string 
     */
    public function load($loadParam) {
        $length = $loadParam;

        mt_srand();
        $symbols = "ABCDEFGHIJKLMNOPQRSTUWVXYZabcdefghijklmnopqrstuvwxyz ";

        $string = "";

        for ($i = 0; $i < $length; $i++) {
            $string .= $symbols[mt_rand() % strlen($symbols)];
        }
        
        return $string;
    }

}